import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerMain {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(Global.port);
        ServerThreadPoolExecutor executor = new ServerThreadPoolExecutor(Global.maxPoolSize,Global.queueSize);
        System.out.println("server startup");
        while (true){
            Socket socket = serverSocket.accept();
            executor.execute(new ServerSocketHandler(socket));
        }
    }
}
